From f46bb02a591d62331c3cd6b2c268080c3698b78d Mon Sep 17 00:00:00 2001 From: Xiaofeng Wang Date: Tue, 31 Mar 2026 11:39:04 +0800 Subject: [PATCH] ci: Sync Rust linting checks from bootc-dev/bootc Align with bootc's validate target: - Make cargo clippy gating (was "non-gating") with the same lint config as bootc (-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code) - Extend clippy to cover test crates (tests/inst, tests/bootc-integration, tests/xtask) - Add cargo doc with -D warnings to catch rustdoc issues Co-Authored-By: Claude Opus 4.6 Signed-off-by: Xiaofeng Wang --- .github/workflows/rust.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1e768863..5f8b8bf0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,8 +33,15 @@ jobs: run: cargo build --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }} - name: Run tests run: cargo test --verbose --features=${{ env['CARGO_PROJECT_FEATURES'] }} - - name: cargo clippy (non-gating) - run: cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} + - name: cargo clippy + run: | + CLIPPY_CONFIG="-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code" + cargo clippy -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} -- $CLIPPY_CONFIG + for d in tests/inst tests/bootc-integration tests/xtask; do + cargo clippy --manifest-path $d/Cargo.toml -- $CLIPPY_CONFIG + done + - name: cargo doc + run: env RUSTDOCFLAGS='-D warnings' cargo doc --lib -p ostree --features=${{ env['CARGO_PROJECT_FEATURES'] }} build-no-features: runs-on: ubuntu-latest container: quay.io/coreos-assembler/fcos-buildroot:testing-devel -- 2.39.5